﻿using System.Data;
using System.Data.SqlClient;
namespace Team4Mock.DAO
{
    public class AddressDAO
    {
        Helper h=new Helper();
        public DataTable Getdata()
        {
            return h.GetData("Add_Getdata");
        }
        public DataTable Search(int index,string postcode,string county,string town)
        {
            SqlParameter[]p=new SqlParameter[4];
            p[0]=new SqlParameter("@index",index);
            p[0].SqlDbType = SqlDbType.Int;
            p[1] = new SqlParameter("@postcode", postcode);
            p[1].SqlDbType = SqlDbType.VarChar;
            p[2] = new SqlParameter("@county", county);
            p[2].SqlDbType = SqlDbType.VarChar;
            p[3] = new SqlParameter("@town", town);
            p[3].SqlDbType = SqlDbType.VarChar;
            return h.GetData("Add_Search", p);
        }
    }
}